<template>
	<view class="">
		<u-navbar :is-back="false" :background="background">
			<view class="flex-end w100 p-r20">
				<image src="/static/images/eqcode.png" mode="" class="eqcode-item m-r20"></image>
				<u-icon name="setting" size="40"></u-icon>
			</view>
		</u-navbar>


		<view class="bg-white br-top-letfright16 margin-lr30 position-r padding30" style="margin-top: 60rpx;" @click="onSkipTap('editStore')">
			<image :src="gShopInfo.logoImg" mode="" class="floating-shadow w-130 h-130 br50 position-a left-center"
				style="top: -45rpx;"></image>
			<view class="center">
				<view class="m-t60" style="font-weight: bold;">{{gShopInfo.name}}</view>
				<view class="fs24 color-gray m-t10">手机号：{{changePhone(gShopInfo.telephone)}}</view>
				<view class="m-t20">
					<u-tag class="m-r10" text="正常营业" type="success" mode="light" size="mini" />
					<!-- <u-tag class="m-r10" text="店铺受限" type="error" mode="light" size="mini" /> -->
					<!-- <u-tag text="违规警告" type="warning" mode="light" size="mini" /> -->
				</view>
			</view>
			<view class="position-a bottom35 color-gray right30" style="font-size: 20rpx;"
				@click.stop="onSkipTap('storeIndex')">
				<text class="m-r10">预览店铺</text>
				<u-icon name="eye"></u-icon>
			</view>


		</view>

		<view class="margin-lr30 bg-white padding-lr30 br-bottom-letfright16">
			<view class="line-x m-b30"></view>
			<view class="flex-bettwen p-b30">
				<view class="center flex1">
					<view class="color-gray fs24">店铺粉丝</view>
					<view class="color-gray m-t20"><text class="color-black" style="font-weight: bold;">21,232</text>人
					</view>
				</view>
				<view class="center flex1">
					<view class="color-gray fs24">账户资金 <u-icon name="eye"></u-icon> </view>
					<view class="color-gray m-t20"><text class="color-black"
							style="font-weight: bold;">￥123,232,232</text></view>
				</view>
				<view class="center flex1">
					<view class="color-gray fs24">店铺保证金</view>
					<view class="color-gray m-t20"><text class="color-black" style="font-weight: bold;">￥2,000,00</text>
					</view>
				</view>
			</view>
		</view>

		<view class="bg-white br16 padding-lr30 margin30" @click="showToast">
			<view class="flex-bettwen padding-tb30">
				<view class="flex-center">
					<image src="/static/images/mine/tonzhi.png" mode="" class="w-40 h-40"></image>
					<view class="m-l20">通知设置</view>
				</view>
				<view class="">
					<u-icon name="arrow-right" class="color-gray"></u-icon>
				</view>
			</view>
			<view class="line-x"></view>
			<view class="flex-bettwen padding-tb30">
				<view class="flex-center">
					<image src="/static/images/mine/safe-center.png" mode="" class="w-40 h-40"></image>
					<view class="m-l20">安全中心</view>
				</view>
				<view class="">
					<u-icon name="arrow-right" class="color-gray"></u-icon>
				</view>
			</view>
			<view class="line-x"></view>
			<view class="flex-bettwen padding-tb30">
				<view class="flex-center">
					<image src="/static/images/mine/follow-back.png" mode="" class="w-40 h-40"></image>
					<view class="m-l20">意见反馈</view>
				</view>
				<view class="">
					<u-icon name="arrow-right" class="color-gray"></u-icon>
				</view>
			</view>
			<view class="line-x"></view>
			<view class="flex-bettwen padding-tb30">
				<view class="flex-center">
					<image src="/static/images/mine/about-us.png" mode="" class="w-40 h-40"></image>
					<view class="m-l20">关于我们</view>
				</view>
				<view class="">
					<u-icon name="arrow-right" class="color-gray"></u-icon>
				</view>
			</view>
			<view class="line-x"></view>
			<view class="flex-bettwen padding-tb30">
				<view class="flex-center">
					<image src="/static/images/mine/clear.png" mode="" class="w-40 h-40"></image>
					<view class="m-l20">清除缓存</view>
				</view>
				<view class="color-gray flex-center">
					<text class="fs24">66.67MB</text>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view class="line-x"></view>
			<view class="flex-bettwen padding-tb30">
				<view class="flex-center">
					<image src="/static/images/mine/check-update.png" mode="" class="w-40 h-40"></image>
					<view class="m-l20">检查更新</view>
				</view>
				<view class="color-gray flex-center">
					<text class="fs24">已是最新版本</text>
					<u-icon name="arrow-right" class=""></u-icon>
				</view>
			</view>
			<view class="line-x"></view>
			<view class="flex-bettwen padding-tb30">
				<view class="flex-center">
					<image src="/static/images/mine/kefu.png" mode="" class="w-40 h-40"></image>
					<view class="m-l20">平台客服</view>
				</view>
				<view class="">
					<u-icon name="arrow-right" class="color-gray"></u-icon>
				</view>
			</view>
		</view>

		<view class="bg-white margin30 br16 padding30 center" @click="logout">
			<u-icon name="zhuanfa"></u-icon>
			<text class="m-l20">退出登录</text>
		</view>
		<view class="" style="height: 100rpx;"></view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				background: {
					backgroundColor: '#f2f2f2',

					// 导航栏背景图
					// background: 'url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat',
					// 还可以设置背景图size属性
					// backgroundSize: 'cover',

					// 渐变色
					// backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
				}
			}
		},
		onShow() {
			this.getUserInfo()
			this.changePhone('13536846272')
		},
		methods: {
			showToast(){
				uni.showToast({
					title:'该功能暂未开发',
					icon:'none'
				})
			},
			logout() {
			    uni.showModal({
			        title: '提示',
			        content: '确认要退出登录?',
			        success: res => {
			            if (res.confirm) {
			                this.$g_util.logout()
			            }
			        }
			    })
			},
			getUserInfo() {
				this.$store.dispatch('updateUserInfo')
			},
			changePhone(phone) {
				return phone.replace(phone.slice(3, 7), '****')
			},
			// 预览店铺
			onSkipTap(type, index) {
				console.log(type);
				let urlObj = {
					login: '/pages/login/index',
					openNewStore: '/pages/apply/openNewStore?pageType=add',
					editStore: '/pages/apply/openNewStore?pageType=edit',
					storeIndex: '/pages/shopInfo/storeIndex',
					vip: '/pages/vip/center',
					wallet: '/pages/wallet/wallet',
					safety: '/pages/me/safety',
					feedback: '/pages/me/feedback',
					aboutMe: '/pages/me/aboutMe',
					kefu: () => {
						this.showKF = true
					},
					cache: () => {
						this.clearCache()
					}
				}
				uni.navigateTo({
					url:urlObj[type]
				})
				
				// this.$g_util.navigationTo(urlObj, type)
			},
		}
	}
</script>

<style scoped lang="scss">
	.eqcode-item {
		width: 40rpx;
		height: 40rpx;
	}

	.logo-item {
		width: 80rpx;
		height: 80rpx;
		border-radius: 50%;
	}
</style>